#include "../mqcommon/helper.hpp"

int main()
{
    mymq::FileHelper helper("../mqcommon/log.hpp");
    DEBUG_LOG("文件是否存在：%d", helper.Exists());
    size_t fsize = helper.Size();
    DEBUG_LOG("文件大小：%ld", fsize);

    mymq::FileHelper _helper("./aaa/bbb/ccc/tmp.hpp");
    if (_helper.Exists() == false)
    {
        std::string ppath = mymq::FileHelper::ParentDirectory("./aaa/bbb/ccc/tmp.hpp");
        if (mymq::FileHelper(ppath).Exists() == false)
        {
            mymq::FileHelper::CreateDirectory(ppath);
        }
        mymq::FileHelper::CreateFile("./aaa/bbb/ccc/tmp.hpp");
    }

    std::string buf;
    helper.Read(&buf);
    _helper.Write(buf);
    _helper.Rename("./aaa/bbb/ccc/test.hpp");
    mymq::FileHelper::RemoveFile("./aaa/bbb/ccc/test.hpp");
    // mymq::FileHelper::RemoveDirectory("aaa");
    mymq::FileHelper::RemoveDirectory("./aaa");

    return 0;
}